import 'package:flutter/material.dart';


class PageNavigator extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Navigator(
      pages: [
        MaterialPage(child: Book(title: 'bookshelf',),key: ValueKey('bookshelf')),
        MaterialPage(child: Book(title: 'book1',),key: ValueKey('book1')),
        MaterialPage(child: Book(title: 'book2',),key: ValueKey('book2')),
      ],
    );
  }
}

class Book extends StatelessWidget {
  final String title;
  Book({this.title});
  @override
  Widget build(BuildContext context) {
    final settings = ModalRoute.of(context).settings;
    return Scaffold(
      appBar: AppBar(title: Text('name: ${settings.name}')),
      body: Container(
        child: Center(
          child: Text('$settings'),
        ),
      ),
    );
  }
}